
HF_LLAMA_PATH=/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/pretrained_models/tencent/Hunyuan-7b-32k-llama2-chat-hf

TP=2
PP=2
CP=2

#HF_LLAMA_PATH=/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/pretrained_models/Llama-2-7b-chat-hf

MEGATRON_FORMAT_DIR=/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/Megatron-LM/hunyuan7b-megatron-TP${TP}-PP${PP}-CP${CP}-TE

python tools/checkpoint/convert.py \
    --model-type GPT \
    --loader llama_mistral_te \
    --saver mcore \
    --model-size llama2-7B \
    --megatron-path /apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/Megatron-LM \
    --target-tensor-parallel-size ${TP} \
    --target-pipeline-parallel-size $PP \
    --checkpoint-type hf \
    --load-dir ${HF_LLAMA_PATH} \
    --save-dir ${MEGATRON_FORMAT_DIR} \
    --tokenizer-model ${HF_LLAMA_PATH} \
    --bf16 \
    --saver-transformer-impl transformer_engine \
    --loader-transformer-impl transformer_engine \
